-
Notifications
You must be signed in to change notification settings - Fork 11
[Bug fix] Do not sample right after flushing profile #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a bug introduced from Issue #15 where we attempt to sample right after flushing profiles even is_profiling_in_progress has been reset to False already
| profiler.stop() | ||
|
|
||
| assert wrapped_add.call_count >= 3 | ||
| # We should see at least 2 sample in 4 seconds as the sequence should happen in the order of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*samples
test/unit/test_profiler_runner.py
Outdated
| self.profiler_runner._profiling_command() | ||
| self.mock_collector.refresh_configuration.assert_called_once() | ||
|
|
||
| def test_when_it_does_not_sample_when_it_reports(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be renamed to "when_it_reports_it_does_not_sample"?
test/unit/test_profiler_runner.py
Outdated
| def test_when_it_does_not_sample_when_it_reports(self): | ||
| self.is_time_to_report = True | ||
|
|
||
| assert(self.profiler_runner._profiling_command()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: no parenthesis.
mirelap-amazon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, please see below.
There was a bug introduced from Issue #15 where we attempt to sample
right after flushing profiles even is_profiling_in_progress has been
reset to False already
Issue #, if available:
#15
Description of changes:
We would not attempt to sample after flushing the profile given that we have also set is_profiling_in_progress to False already.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.